<template>
    <div>
        <div class="detail-all"
             v-for="(item, index) in list" :key="index">
            <div class="detail-title border-bottom">
                <span class="title-icon"></span>
                {{item.title}}
            </div>
            <div v-if="item.children" class="children-title">
                <detaillist :list='item.children'></detaillist> <!--  调用递归组件，通过自己的name使用自己这个组件 -->
            </div>
        </div>
    </div>
</template>

<script>
export default {
    name: 'detaillist',
    props:{
        list:Array
    }
}
</script>

<style scoped>
    .detail-title{
        line-height: .8rem;
        height: .8rem;
        font-size: .32rem;
        padding: 0 .2rem;
    }
    .title-icon{
        position: relative;
        top: .06rem;
        right: .05rem;
        display: inline-block;
        width: .36rem;
        height: .36rem;
        background: url(http://s.qunarzz.com/piao/image/touch/sight/detail.png) 0 -.45rem no-repeat;
        margin-right: .1rem;
        background-size: .4rem 3rem;
    }
    .children-title{
        padding: 0 .4rem;
    }
</style>